Skip to content

refactor(launchpad): use shared tooltip timing - #865

Merged
wjyrich merged 1 commit into
linuxdeepin:develop/2500u3from
wjyrich:fix/task-399397-tooltip-u3
Nov 30, 2026
Merged

wjyrich merged 1 commit into
linuxdeepin:develop/2500u3from
wjyrich:fix/task-399397-tooltip-u3

Conversation

@wjyrich

@wjyrich wjyrich commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

移除启动器图标自己的 50 毫秒提示计时器。悬停时由 PanelToolTip 按公共的 300 毫秒延时显示,指针离开或点击图标时取消待显示提示。

对应的 dde-shell PR:https://github.com/linuxdeepin/dde-shell/pull/1898。请先合入该 PR。

验证:启动器 QML 检查通过。

Summary by Sourcery

Enhancements:

  • Use the shared PanelToolTip timing for launcher icon tooltips and cancel tooltip display when the pointer leaves or the icon is clicked.

PMS: TASK-399397

1. Remove the launcher icon's local show timer.
2. Delegate hover timing and cancellation to PanelToolTip.

Log: Use the shared tooltip delay for the launcher icon.
Influence: Launcher and Dock tooltip delays match.

refactor(launchpad): 复用任务栏提示计时

1. 移除启动器图标自己的显示计时器。
2. 将悬停计时和取消交给 PanelToolTip。

Log: 启动器图标使用任务栏的公共提示延时。
Influence: 启动器与任务栏的提示延时一致。
PMS: TASK-399397
@sourcery-ai

sourcery-ai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Reviewer's Guide

UI

Remove the launcher icon’s local 50 ms tooltip timer and use PanelToolTip’s shared hover timing, while opening the tooltip at the launcher’s position and closing it when the pointer leaves.

  • shell-launcher-applet/package/launcheritem.qml L489 (removed lines), L512-514, L516 (removed lines)

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="shell-launcher-applet/package/launcheritem.qml" line_range="514" />
<code_context>
-        onTriggered: {
-            var point = Applet.rootObject.mapToItem(null, Applet.rootObject.width / 2, Applet.rootObject.height / 2)
-            toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height)
-            toolTip.open()
-        }
-    }
</code_context>
<issue_to_address>
**Tooltip appears after right-click**

When the pointer is hovering over the icon and the user right-clicks before the shared tooltip delay expires, the right-button tap is accepted, but the handler only calls `toggleLauncher()` for left-button clicks and does not close or cancel the pending tooltip. `PanelToolTip.open()` therefore completes its delay and the tooltip appears after the right-click.

Cancel or close the pending tooltip when the handler accepts a right-button tap.

Also at `shell-launcher-applet/package/launcheritem.qml:515`.
</issue_to_address>

### Comment 2
<location path="shell-launcher-applet/package/launcheritem.qml" line_range="512-513" />
<code_context>
         onHoveredChanged: {
             if (hovered) {
-                toolTipShowTimer.start()
+                const point = launcher.mapToItem(null, launcher.width / 2, launcher.height / 2)
+                toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height)
+                toolTip.open()
             } else {
</code_context>
<issue_to_address>
**Tooltip appears at old position**

When the dock or launcher moves or resizes while the tooltip is waiting to open, the hover handler captures the launcher bounds before `PanelToolTip.open()` waits for the shared delay. The dock movement leaves `DockPanelPositioner.bounding` stale, so the tooltip appears at the launcher’s previous position.

Update `DockPanelPositioner.bounding` after the delay using the launcher’s current position and size.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

toolTipShowTimer.start()
const point = launcher.mapToItem(null, launcher.width / 2, launcher.height / 2)
toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height)
toolTip.open()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Tooltip appears after right-click

When the pointer is hovering over the icon and the user right-clicks before the shared tooltip delay expires, the right-button tap is accepted, but the handler only calls toggleLauncher() for left-button clicks and does not close or cancel the pending tooltip. PanelToolTip.open() therefore completes its delay and the tooltip appears after the right-click.

Cancel or close the pending tooltip when the handler accepts a right-button tap.

Also at shell-launcher-applet/package/launcheritem.qml:515.

Prompt for AI agents
In `shell-launcher-applet/package/launcheritem.qml` at line 514:

**Tooltip appears after right-click**

When the pointer is hovering over the icon and the user right-clicks before the shared tooltip delay expires, the right-button tap is accepted, but the handler only calls `toggleLauncher()` for left-button clicks and does not close or cancel the pending tooltip. `PanelToolTip.open()` therefore completes its delay and the tooltip appears after the right-click.

Cancel or close the pending tooltip when the handler accepts a right-button tap.

Also at `shell-launcher-applet/package/launcheritem.qml:515`.

Comment on lines +512 to +513
const point = launcher.mapToItem(null, launcher.width / 2, launcher.height / 2)
toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Tooltip appears at old position

When the dock or launcher moves or resizes while the tooltip is waiting to open, the hover handler captures the launcher bounds before PanelToolTip.open() waits for the shared delay. The dock movement leaves DockPanelPositioner.bounding stale, so the tooltip appears at the launcher’s previous position.

Update DockPanelPositioner.bounding after the delay using the launcher’s current position and size.

Prompt for AI agents
In `shell-launcher-applet/package/launcheritem.qml` at lines 512-513:

**Tooltip appears at old position**

When the dock or launcher moves or resizes while the tooltip is waiting to open, the hover handler captures the launcher bounds before `PanelToolTip.open()` waits for the shared delay. The dock movement leaves `DockPanelPositioner.bounding` stale, so the tooltip appears at the launcher’s previous position.

Update `DockPanelPositioner.bounding` after the delay using the launcher’s current position and size.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, wjyrich

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wjyrich
wjyrich merged commit f950824 into linuxdeepin:develop/2500u3 Nov 30, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants